Skip to content

test(auth): cover the write-through recoveries and the custom reauth slot's sheet chrome - #2476

Merged
russellwheatley merged 2 commits into
version-10.0.0-beta05from
feat/reauth-and-recovery-test-coverage
Sep 4, 2026
Merged

test(auth): cover the write-through recoveries and the custom reauth slot's sheet chrome#2476
russellwheatley merged 2 commits into
version-10.0.0-beta05from
feat/reauth-and-recovery-test-coverage

Conversation

@demolaf

@demolaf demolaf commented Sep 3, 2026

Copy link
Copy Markdown
Member

Three error recoveries hand the step they navigate to a value the failure carried, and none were covered: AccountLinkingRequiredException writes pendingLinkingCredential, and EmailLinkPromptForEmailException / EmailLinkCrossDeviceLinkingException both write emailLinkFromDifferentDevice. Separately, a custom reauthContent slot is Bare only on MethodPicker — email and phone sub-steps still wrap in the library sheet, and nothing asserted that chrome was present.

  • FirebaseAuthScreenEmailRecoveryTest: 7 cases covering landing step and address for each of the three exceptions, plus the write-through itself — a real linkWithCredential verification for account linking, and isSignInWithEmailLink for both email-link failures.
  • ReauthSurfaceGateTest: 3 cases — the method picker composes bare under a custom slot, and the email and phone steps are asserted to be inside the sheet via ancestry rather than as separate presence checks.

Checked each case against a mutated production branch: dropping the credential write, nulling the prompt's link, swapping the cross-device branch to providerName, and ignoring the step in the reauth gate each fail only their own test.


Maintainer note: Fixes internal CPRN-404

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive unit tests to FirebaseAuthScreenEmailRecoveryTest.kt and ReauthSurfaceGateTest.kt. The new tests in FirebaseAuthScreenEmailRecoveryTest.kt verify account recovery flows that pass data (such as credentials or links) to subsequent steps, including account linking, email-link prompts, and cross-device linking. The tests added to ReauthSurfaceGateTest.kt validate the behavior of custom-slot presentation gates, ensuring that the method picker is rendered bare while sub-flows are properly enclosed within the library's sheet. There are no review comments, and I have no feedback to provide.

@demolaf
demolaf marked this pull request as ready for review September 4, 2026 12:36
@demolaf
demolaf force-pushed the feat/reauth-and-recovery-test-coverage branch from 06d3dd4 to 681dc8d Compare September 4, 2026 12:54
@demolaf
demolaf marked this pull request as draft September 4, 2026 12:54
@demolaf
demolaf marked this pull request as ready for review September 4, 2026 12:59
@russellwheatley
russellwheatley merged commit dfab195 into version-10.0.0-beta05 Sep 4, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in studio-2394994192-60a69 Sep 4, 2026
demolaf added a commit that referenced this pull request Sep 6, 2026
…slot's sheet chrome (#2476)

* test(auth): cover the three recoveries that write a value through to the step they move to

* test(auth): assert a custom reauth slot's email and phone steps stay inside the library sheet
demolaf added a commit that referenced this pull request Sep 7, 2026
* fix(auth)!: remove non-functional MFA recovery codes (#2457)

* refactor(auth): scope phone verification loading state to the composition that owns it (#2454)

* refactor(auth): let the phone screen own its verification loading state

* fix(auth): read auth state per authUI instance when clearing loading on dispose

* fix(e2e): fix flaky Google credential-linking test (#2455)

* fix(auth): complete MFA challenge sign-in navigation and success callback (#2458)

* feat(auth): add stable resource ids for auth input fields (#2449)

* fix(auth): log diagnostic warning when Google sign-in NoCredentialException fallback exhausts

(cherry picked from commit 6fa4f00)
(cherry picked from commit aca99e7)
(cherry picked from commit 8784b13ce29739ed7785aab9ab6fe4faad2a2981)

* fix(e2e): retry and fail loudly when clearing Firebase Auth emulator data

(cherry picked from commit 8eca4fa)
(cherry picked from commit ac61312)
(cherry picked from commit 126ba985660ff272dbfda427b644ad4fb1ca6197)

* fix(e2e): don't swallow InterruptedException in emulator clear retry loop

(cherry picked from commit a87cfe3)
(cherry picked from commit 3f4ae70)
(cherry picked from commit 1f1ada380039ed5e7476dfc2e38a683e6edb4549)

* feat(auth): reshape reauthContent into a ReauthContentState content slot (#2452)

* feat(auth): reshape reauthContent into a ReauthContentState content slot

* fix(auth): address reauth review findings and retain state across recreation

* refactor(auth): make reauthentication a request-scoped state machine

* fix(auth): keep a proved reauthentication alive when its operation signs out

* fix(auth): tear down phone verification when a reauthentication attempt fails

* test(auth): cover sign-out-during-retry and phone reauth failure end to end

* test(auth): drop the flaky phone reauth e2e case

* test(auth): pin onComplete and factor refresh on successful MFA enrollment (#2462)

* test(auth): pin onComplete and factor refresh on successful MFA enrollment

* test(auth): pin the SMS MFA enrollment route through send, verify and resend

* test(auth): pin the missing TOTP secret guard and the resend's clean enroll

* feat(auth)!: make each email sign-in mode a real navigation destination (#2466)

* feat(auth): make each MFA enrollment step a real navigation destination (#2467)

* feat(auth)!: migrate auth navigation to Navigation 3 (#2469)

* feat(auth): make reauthentication a navigation destination (#2471)

* fix(auth): clear MFA enrollment flow state on every entry (#2473)

* feat(auth): make each phone auth step a real navigation destination (#2472)

* fix(auth): don't strand phone-only users on email verification after reload (#2474)

* test(auth): cover the write-through recoveries and the custom reauth slot's sheet chrome (#2476)

* test(auth): cover the three recoveries that write a value through to the step they move to

* test(auth): assert a custom reauth slot's email and phone steps stay inside the library sheet

---------

Co-authored-by: Ademola Fadumo <48495111+demolaf@users.noreply.github.com>
Co-authored-by: demolaf <demolafadumo@gmail.com>
@demolaf demolaf mentioned this pull request Sep 7, 2026
demolaf added a commit that referenced this pull request Sep 7, 2026
…slot's sheet chrome (#2476)

* test(auth): cover the three recoveries that write a value through to the step they move to

* test(auth): assert a custom reauth slot's email and phone steps stay inside the library sheet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants